package javax;

public class Demo2 {
    public int getNum(int[] arr,int L ,int R){
        if (L==R || arr.length <2){
            return arr[L];
        }
/*        int mid = L+(R+L)>>1;*/
        int temp = 1;
        int num = 0;
        for (int i = 0 ;i<arr.length;i++){
            if (arr[i] == temp){
                num = i;
                return num;
            }else {
                return -1;
            }
        }
        return num;
    }

}
